日志样式

验证RIP V2 不支持CIDR汇总,但可传递CIDR汇总特性

在前面一个实验我们已经做了关于RIPv2的简单配置和手动汇总的实验,下面这个实验主要目的是为了验证下RIP V2 不支持CIDR汇总,但可传递CIDR汇总特性。
 
实验目标:验证RIP V2 不支持CIDR汇总,但可传递CIDR汇总特性
 
拓扑:
 
R1 R2 R3 的实验配置和上一个RIPv2 实验的配置是一样的,详细配置请自己查看哦,为了不浪费时间这里就不在重复了哦!配置是完全一样的,我们要改的是R4,前一个实验我们是在R4是配置了四个loop0口,且ip 分别是2.2.2.2 2.2.3.2 2.2.4.2 2.2.5.2 那么我们现在要做的是将这四个loop0口的ip 分别改给成 192.168.96.4/24, 192.168.97.4/24, 192.168.98.4/24,192.168.99.4/24. 配置如下:
 
R4:
R4#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R4(config)#int loop 0
R4(config-if)#ip add 192.168.96.4 255.255.255.0
R4(config-if)#no shut
R4(config-if)#int loop
*Nov 8 16:56:01.495: %LINK-3-UPDOWN: Interface Loopback0, changed state to up
*Nov 8 16:56:02.495: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R4(config-if)#int loop1
R4(config-if)#ip add 192.168.97.4 255.255.255.0
R4(config-if)#no shut
R4(config-if)#int loop2
R4(config-if)#ip add 192.168.98.4 255.255.255.0
R4(config-if)#no shut
R4(config-if)#int loop
*Nov 8 16:56:59.619: %LINK-3-UPDOWN: Interface Loopback2, changed state to up
*Nov 8 16:57:00.619: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback2, changed state to up
R4(config-if)#int loop3
R4(config-if)#ip add 192.168.99.4 255.255.255.0
R4(config-if)#^Z
R4#
*Nov 8 16:57:29.415: %SYS-5-CONFIG_I: Configured from console by console
R4#
在R4上启动RIPv2协议:
R4#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R4(config)#router rip
R4(config-router)#version 2
R4(config-router)#no auto-s
R4(config-router)#net 192.168.96.0
R4(config-router)#net 192.168.97.0
R4(config-router)#net 192.168.98.0
R4(config-router)#net 192.168.99.0
R4(config-router)#net 192.168.2.0
R4(config-router)#^Z
R4#
 
在R1上查看"show ip route"查看路由表:
*Nov 8 16:59:21.943: RIP: ignored v2 packet from 1.1.1.1 (sourced from one of our addresses)
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
R 192.168.98.0/24 [120/3] via 192.168.0.2, 00:00:15, Serial1/1
R 192.168.96.0/24 [120/3] via 192.168.0.2, 00:00:27, Serial1/1
R 192.168.97.0/24 [120/3] via 192.168.0.2, 00:00:22, Serial1/1
C 192.168.0.0/24 is directly connected, Serial1/1
R 192.168.1.0/24 [120/1] via 192.168.0.2, 00:00:27, Serial1/1
R 192.168.2.0/24 [120/2] via 192.168.0.2, 00:00:27, Serial1/1
R1#
 
以上表明R上已经学到了R4上重新配置好的四条loop0口信息,下面我们来汇总R4看看有什么变化:
 
R4#
R4#conf
Configuring from terminal, memory, or network [terminal]? t
Enter configuration commands, one per line. End with CNTL/Z.
R4(config)#int s1/0
R4(config-if)#ip summary-add rip 192.168.96.0 255.255.252.0
Summary mask must be greater or equal to major net
R4(config-if)#
 
显示提示信息表明汇总后的掩码长度必须哟大于或等于主类网络掩码的掩码长度,因为“22<24”,所以不能汇总。
所以RIPV2不支持CIDR汇总,但是可以传递CIDR汇总。
方法:
我们用静态路由发布被汇总的路由:
*Nov 8 17:10:35.415: %SYS-5-CONFIG_I: Configured from console by console
R4#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R4(config)#ip route 192.168.96.0 255.255.252.0 null0 \\静态路由发布被汇总的路由
R4(config)#route rip
R4(config-router)#redistribute static \\将静态路由重发布到RIP路由协议中
R4(config-router)#no net 192.168.96.0
R4(config-router)#no net 192.168.97.0
R4(config-router)#no net 192.168.98.0
R4(config-router)#no net 192.168.99.0
R4(config-router)#^Z
R4#
 
赶快验证下哦!呵呵!在R1上“show ip route”
R1:

R1#R4(config-router)#^Z
% Unknown command or computer name, or unable to find computer address
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
C 192.168.0.0/24 is directly connected, Serial1/1
R 192.168.1.0/24 [120/1] via 192.168.0.2, 00:00:08, Serial1/1
R 192.168.2.0/24 [120/2] via 192.168.0.2, 00:00:08, Serial1/1
R 192.168.96.0/22 [120/3] via 192.168.0.2, 00:00:08, Serial1/1
R1#
 
总结:输出结果表明R4将汇总转递给了R1!验证了RIP V2 不支持CIDR汇总,但可传递CIDR汇总特性!